<template>
  <div id="qianqichjgcs" class="app-container">
    <div class="tabs dachuShenChaBox">
      <el-tabs v-model="activeName">
        <el-tab-pane label="图件审查" name="1" />
        <el-tab-pane label="附件审查" name="2" />
      </el-tabs>
      <div class="dachuShenCha">
        <div class="dachuShenCha_item" @click="exportOpinion">
          <i class="el-icon-upload2" /> 导出审查意见
        </div>
        <div v-if="!isLook" class="dachuShenCha_item" @click="checkTijiao">
          <i class="el-icon-document-checked" /> 校验审查意见
        </div>
      </div>
    </div>
    <div v-show="activeName=='1'" v-loading="listLoading" class="tdMap-box">
      <tdMap
        ref="tdMap"
        :pk-list="list"
        :xian-zhuang-path="xianZhuangFliePath"
        :cuowu-list="cuowuListData"
        :yijian-info="yijianInfoData"
        :is-look="isLook"
        layer-name="LandCertificate"
        link-value="QUALIFIED_CERTIFICATE_APPLICATION_SECOND_AUDIT"
      >
        <template slot="buttonGroup">
          <el-dropdown class="CAD" @command="handleXzViewInto">
            <el-button class="line" size="medium">
              CAD查看
              <i class="el-icon-arrow-down el-icon--right" />
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="66">复垦前远近图查看</el-dropdown-item>
              <el-dropdown-item command="67">复垦后远近图查看</el-dropdown-item>
              <el-dropdown-item command="1">前期测绘现状图</el-dropdown-item>
              <el-dropdown-item command="2">竣工测绘现状图</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
        <div v-if="curIndex != null" slot="popupBaseInfo">
          <table cellspacing="0" class="tableBasicInfo">
            <tr>
              <th>权利人</th>
              <td>{{ list[curIndex].qlr }}</td>
            </tr>
            <tr>
              <th>身份证号</th>
              <td>{{ list[curIndex].idCard }}</td>
            </tr>
            <tr>
              <th>所在乡镇</th>
              <td>{{ list[curIndex].townName }}</td>
            </tr>
            <tr>
              <th>建设用地复垦面积</th>
              <td>{{ list[curIndex].nczjd | M2 }}</td>
            </tr>
            <tr>
              <th>农村宅基地面积</th>
              <td>{{ list[curIndex].zjdfs | M2 }}</td>
            </tr>
            <tr>
              <th>预计减少建设用地面积</th>
              <td>{{ list[curIndex].jsjsydmj | M2 }}</td>
            </tr>
            <tr>
              <th>预计增加农用地面积</th>
              <td>{{ list[curIndex].yjxznydmj | M2 }}</td>
            </tr>
            <tr>
              <th>预计增加耕地面积</th>
              <td>{{ list[curIndex].xzgdmj | M2 }}</td>
            </tr>
            <tr>
              <th>预计增加林地面积</th>
              <td>{{ list[curIndex].xzldmj | M2 }}</td>
            </tr>
            <tr>
              <th>预计增加园地面积</th>
              <td>{{ list[curIndex].zjydmj | M2 }}</td>
            </tr>
            <tr>
              <th>预计增加其他农用地面积</th>
              <td>{{ list[curIndex].xzqtnydmj | M2 }}</td>
            </tr>
            <tr>
              <th>拟复垦宅基地产权证号</th>
              <td>{{ list[curIndex].nfkzjdcq }}</td>
            </tr>
            <tr>
              <th>采用用地附属</th>
              <td>{{ list[curIndex].cyydfs }}</td>
            </tr>
          </table>
        </div>
        <div slot="popupJgInfo">
          <div class="zonghexinxiFirst zonghexinxiItem">
            <div class="zonghexinxiLeft">外业核查</div>
            <div class="item-box">
              <div class="one-item one-item-item item-box-firstItem">市级抽查复核时间：{{ jgBasicInfo.time }}</div>

              <div class="item-box-box one-item-item">
                <div class="item-box-box-left">
                  <el-checkbox v-model="jgBasicInfo.checked1" disabled>复垦面积与竣工测绘成果是否一致</el-checkbox>
                </div>
              </div>
              <div class="item-box-box one-item-item">
                <div class="item-box-box-left">
                  <el-checkbox v-model="jgBasicInfo.checked2" disabled>复垦位置是否准确</el-checkbox>
                </div>
              </div>
              <div class="item-box-box one-item-item">
                <div class="item-box-box-left">
                  <el-checkbox v-model="jgBasicInfo.checked3" disabled>复垦质量是否达标</el-checkbox>
                </div>
              </div>

              <div class="table-box">
                <div class="table-box-left table-box-item">外业核查资料</div>
                <div class="table-box-right table-box-item">
                  <ul v-if="jgBasicInfo.imgArr.length != 0" class="ziliaoList">
                    <li
                      v-for="(item, index) in jgBasicInfo.imgArr"
                      :key="index"
                      @click="handleImageDialog(item)"
                    >{{ item.name }}</li>
                  </ul>
                  <div v-else class="no-data">暂无信息</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </tdMap>
    </div>
    <fujian
      v-show="activeName == '2'"
      ref="fujianChild"
      :isLook="isLook"
      :fujianList="attachmentInfo"
      :cuowuList="wuowuList"
      :linkValue="linkValue"
    ></fujian>
    <el-dialog
      :close-on-click-modal="false"
      title="审查意见"
      :visible.sync="shenchaFlag1"
      :before-close="handleClose1"
      class="shenChaTanKuang"
    >
      <div class="shenChaContent">
        <div class="shenchaItem_item">
          <p>问题类型：</p>
          <div class="shenchaItem_item">
            <el-select
              v-model="itemDataForTable.problemReclaimPointOpinionType"
              class="shenchaBox_item_input"
              placeholder="--请选择--"
              @change="changeNeiye"
            >
              <el-option
                v-for="item in wuowuList"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              />
            </el-select>
          </div>
        </div>
        <div v-if="noWenti" class="shenchaItem_item_noFlex">
          <p>问题记录：</p>
          <div class="shenchaItem_item">
            <el-input
              v-model="itemDataForTable.problemReclaimProblemRecord"
              class="shenchaItem_item_textarea"
              type="textarea"
              :rows="5"
              :readonly="isReadOnly"
              placeholder="请输入内容"
            />
          </div>
        </div>
      </div>
      <span v-if="!isLook" slot="footer" class="dialog-footer">
        <el-button @click="shenchaFlag1 = false">取 消</el-button>
        <el-button
          v-loading.fullscreen.lock="fullscreenLoading"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)"
          type="primary"
          @click="submitYj1"
        >确 定</el-button>
      </span>
    </el-dialog>

    <!-- 查看复垦前后图片 -->
    <el-dialog :close-on-click-modal="false" :title="seeImgTitle" :visible.sync="seeImgDialog" width="50%">
      <seeImg :img-arr="imgArr" :quan-tu="panoramaImg" />
    </el-dialog>
    <el-dialog
      :close-on-click-modal="false"
      title="外业审查意见"
      :visible.sync="shenchaFlag2"
      :before-close="handleClose2"
      class="shenChaTanKuang"
    >
      <div class="shenChaContent">
        <div class="wyJibenxinxi">
          <div class="zonghexinxiFirst zonghexinxiItem">
            <div class="zonghexinxiLeft">外业核查</div>
            <div class="item-box">
              <div class="one-item one-item-item item-box-firstItem">市级抽查复核时间：{{ jgBasicInfo.time }}</div>

              <div class="item-box-box one-item-item">
                <div class="item-box-box-left">
                  <el-checkbox v-model="jgBasicInfo.checked1" disabled>复垦面积与竣工测绘成果是否一致</el-checkbox>
                </div>
              </div>
              <div class="item-box-box one-item-item">
                <div class="item-box-box-left">
                  <el-checkbox v-model="jgBasicInfo.checked2" disabled>复垦位置是否准确</el-checkbox>
                </div>
              </div>
              <div class="item-box-box one-item-item">
                <div class="item-box-box-left">
                  <el-checkbox v-model="jgBasicInfo.checked3" disabled>复垦质量是否达标</el-checkbox>
                </div>
              </div>
            </div>
          </div>
          <div class="zonghexinxiFirst zonghexinxiItem">
            <div class="zonghexinxiLeft">外业核查资料</div>
            <div class="item-box">
              <div class="table-box-right table-box-item">
                <ul v-if="jgBasicInfo.imgArr.length != 0" class="ziliaoList">
                  <li
                    v-for="(item, index) in jgBasicInfo.imgArr"
                    :key="index"
                    @click="handleImageDialog(item)"
                  >{{ item.name }}</li>
                </ul>
                <div v-else class="no-data">暂无信息</div>
              </div>
            </div>
          </div>
        </div>
        <div class="shenchaItem">
          <p>是否通过：</p>
          <div class="shenchaItem_item">
            <el-radio-group v-model="waiyeObj.waiyeRadio">
              <el-radio label="YES">是</el-radio>
              <el-radio label="NO">否</el-radio>
            </el-radio-group>
          </div>
        </div>
      </div>
      <span v-if="!isLook" slot="footer" class="dialog-footer">
        <el-button @click="shenchaFlag2 = false">取 消</el-button>
        <el-button
          v-loading.fullscreen.lock="fullscreenLoading"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)"
          type="primary"
          @click="submitWy"
        >确 定</el-button>
      </span>
    </el-dialog>
    <!-- 综合监管信息图片、视频查看 -->
    <el-dialog
      :close-on-click-modal="false"
      :title="jgTitle"
      :visible.sync="imgShow"
      :before-close="handleCloseJg"
      class="imgDaolig"
    >
      <div v-if="showImgType == 1" class="imgBox" style="width:500px;height:500px;margin:0 auto;">
        <img style="width:100%;height:100%;" :src="$https + imgSrc" alt />
      </div>
      <div v-if="showImgType == 2" class="imgBox" style="width:700px;height:400px;margin:0 auto;">
        <video
          id="showVedio"
          autoplay
          controls
          style="width:100%;height:100%;"
          :src="$https + imgSrc"
        />
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  queryOpinionType,
  queryLandCertificateSectiondAuditInfo,
  queryCheckEnclosure,
  auditSecondAuditInfo,
  saveCheckEnclosureOpinion,
  verifyAttachmentOpinion,
  queryEarlyXzt,
  queryJungongXzt,
  auditEarlyStatusMapInfo,
  auditLandStatusMapInfo,
  hgzAuditLandOuterInfo
} from "@/api/shijiChouchaFuhe";
import { supervisingInfo, supervisingCheck } from "@/api/hegezhengPeihao";
import { getQuestionsOpinionType } from "@/api/getOpinion";
import tdMap from "@/components/tdMap";
import fujian from "@/components/fujianList";

import seeImg from "@/components/seeImg";
export default {
  filters: {},
  components: {
    tdMap,
    seeImg,
    fujian
  },
  data() {
    return {
      linkValue: "QUALIFIED_CERTIFICATE_APPLICATION_SECOND_AUDIT",
      xianZhuangFliePath: "",
      cuowuListData: [],
      qswuowuList: [],
      noWenti: false,
      shenchaFlag1: false,
      xianzhuangtuSrc: "",
      dialogTitle1: "前期测绘现状图",
      // 外业单选
      waiyeObj: {
        waiyeRadio: "",
        landId: ""
      },
      shenchaFlag2: false,
      noWenti: true,
      shenchaFlag1: false,
      xianzhuangtuSrc: "",
      dialogTitle1: "前期测绘现状图",
      fullscreenLoading: false, //全屏加载
      wuowuList: [], //错误类型数组
      radio: "YES", //该片块图件是否为遗漏复垦点
      radio1: "YES", //审定规模与送审规模是否一致
      textarea: "",
      value: "",
      showChaKan: false, //显示隐藏查看框
      data: [
        {
          id: 1,
          label: "土地利用规划",
          children: [
            {
              id: 8,
              label: "总体规划"
            },
            {
              id: 9,
              label: "管理区规划"
            },
            {
              id: 10,
              label: "土地整治规划"
            }
          ]
        },
        {
          id: 2,
          label: "土地利用现状",
          children: [
            {
              id: 5,
              label: "2018年"
            },
            {
              id: 6,
              label: "2017年"
            }
          ]
        }
      ],
      activeName: "1",
      list: [],
      listLoading: false,
      listQuery: {
        page: 1,
        size: 10
      },
      total: 0, // 总数
      defaultProps: {
        children: "children",
        label: "label"
      },
      shenchaFlag: false, // 审查弹框控制
      showThreeFlag: false, // 是否显示三个输入框
      fujianList: [], // 附件数组
      itemData: "", // 单个附件的数据
      yijianValue: "", // 意见值
      yijianContent: "", // 意见内容
      itemDataForTable: {
        landId: "", // 片块ID
        isExistQuestions: "", // 该片块图件是否存在问题
        isSetFukend: "", // 是否设定为疑问复垦点
        problemReclaimProblemRecord: "", // 意见内容
        problemReclaimPointOpinionType: "" // 意见类型
      },
      dialogTitle: "", // 弹框标题
      nowType: 1, // 1为前期现状图 2为竣工现状图
      flag: 1,
      input: "",
      value1: "",
      queryCityCenterInfo: "", // 基本信息
      opionionList: [], // 意见类型
      opinionValue: "", // 意见值
      attachmentInfo: "", // 附件信息
      opinionContent: "", // 意见内容
      attachment: "", // 单个附件信息
      attachmentType: "", // 附件类型
      mapConfig: {
        map: null,
        lng: 106.55,
        lat: 29.57,
        zoom: 10,
        lay: null
      },
      T: null,
      isText: true,
      loading: false,

      imgArr: [], // 远近景照片
      seeImgDialog: false, // 图片弹框
      seeImgTitle: "复垦远近景照片", // 图片标题
      quanImg: {
        filePath: "",
        fileName: "全景照"
      },
      panoramaImg: "",

      isLook: false, // 判断当前流程（是否操作）

      isReadOnly: false,
      isShowCheck: true, // 判断是否是查看附件

      curIndex: null,
      // 意见
      yijianInfoData: {
        yijianValue: "",
        yijianContent: "",
        status: ""
      },
      jgBasicInfo: {
        // 监管信息
        checked1: "",
        checked2: "",
        checked3: "",
        time: "",
        imgArr: []
      },
      imgShow: false,
      jgTitle: "查看",
      imgSrc: "",
      showImgType: "" // 区别视频或者图片 1 图片 2 视频
    };
  },
  created() {
    if (
      localStorage.getItem("router") ==
      "QUALIFIED_CERTIFICATE_APPLICATION_SECOND_AUDIT"
    ) {
      this.isReadOnly = false;
    } else {
      this.isReadOnly = true;
      this.isLook = true;
    }
    if (localStorage.getItem("lookStatus") == 2) {
      this.isReadOnly = true;
      this.isLook = true;
    }
    this.getData();
    this.getOpinionType();
    this.getAttachment();
  },
  methods: {
    handleCloseJg() {
      // 关闭监管信息弹窗
      this.imgShow = false;
      var vedio = document.getElementById("showVedio");
      vedio.currentTime = 0;
      vedio.pause();
    },
    handleImageDialog(row) {
      // 查看综合监管信息图片、视频
      this.imgShow = true;
      this.imgSrc = row.path;
      this.showImgType = row.type;
      if (row.type == 1) {
        this.jgTitle = "查看图片";
      } else {
        this.jgTitle = "查看视频";
        this.$nextTick(() => {
          var vedio = document.getElementById("showVedio");
          vedio.play();
        });
      }
    },
    // 问题记录
    wentijilu(row) {
      var that = this;
      var data = {
        landId: row.landId,
        statusMapOpinion: row.yijianContent,
        statusMapOpinionType: row.yijianValue
      };

      if (this.nowType == 1) {
        auditEarlyStatusMapInfo(data)
          .then(res => {
            this.$refs.tdMap.closeXianZhuang();
            this.$refs.tdMap.closeMapIframe();
            if (res.code == 1000) {
              this.$message({
                message: "审查成功",
                type: "success"
              });
            }
          })
          .catch(() => {
            this.$refs.tdMap.closeXianZhuang();
          });
      } else if (this.nowType == 2) {
        auditLandStatusMapInfo(data)
          .then(res => {
            this.$refs.tdMap.closeXianZhuang();
            this.$refs.tdMap.closeMapIframe();
            if (res.code == 1000) {
              this.$message({
                message: "审查成功",
                type: "success"
              });
            }
          })
          .catch(() => {
            this.$refs.tdMap.closeXianZhuang();
          });
      }
    },
    // 获取现状图
    getXianZhangData(data) {
      var _data = {
        landId: data.landId
      };
      if (this.nowType == 1) {
        queryEarlyXzt(_data).then(res => {
          this.xianZhuangFliePath = res.data.statusMap.filePath;
          this.yijianInfoData.yijianValue =
            res.data.auditDto.statusMapProblemType;
          this.yijianInfoData.yijianContent =
            res.data.auditDto.statusMapProblemRecord;
          this.yijianInfoData.status = res.data.auditDto.statusMapProblemStatus;
        });
      } else if (this.nowType == 2) {
        queryJungongXzt(_data).then(res => {
          this.xianZhuangFliePath = res.data.statusMap.filePath;
          this.yijianInfoData.yijianValue =
            res.data.auditDto.statusMapProblemType;
          this.yijianInfoData.yijianContent =
            res.data.auditDto.statusMapProblemRecord;
          this.yijianInfoData.status = res.data.auditDto.statusMapProblemStatus;
        });
      }
    },
    // 前往查看现状图
    toSeeXianZhuang(row) {
      if (this.nowType == 66) {
        this.chakanImg(row, 1);
      } else if (this.nowType == 67) {
        this.chakanImg(row, 2);
      } else {
        this.getXianZhangData(row);
      }
    },
    // 打开现状图
    handleXzViewInto(num) {
      this.nowType = Number(num);
      this.$refs.tdMap.handleXzView();
    },
    getZongheInfo(landId) {
      // 查询综合监管信息
      let obj = {
        page: 1,
        size: 1,
        projectId: localStorage.getItem("projectId"),
        landId: landId
      };
      supervisingInfo(obj).then(res => {
        let data = res.data.rows[0];
        this.jgBasicInfo.checked1 =
          data.ifmjxd == "YES" ? true : data.ifmjxd == "NO" ? false : "";
        this.jgBasicInfo.checked2 =
          data.ifwzzq == "YES" ? true : data.ifmjxd == "NO" ? false : "";
        this.jgBasicInfo.checked3 =
          data.iffkzl == "YES" ? true : data.ifmjxd == "NO" ? false : "";

        this.jgBasicInfo.time = data.time;
        this.$nextTick(() => {
          let obj1 = {
            page: 1,
            size: 10,
            photo: data.photo ? data.photo : "",
            vcr: data.vcr ? data.vcr : ""
          };
          supervisingCheck(obj1).then(res1 => {
            var imageGeShi = [
              "bmp",
              "pcx",
              "png",
              "jpg",
              "jpeg",
              "gif",
              "tiff"
            ];
            var videoGeShi = [
              "mp4",
              "avi",
              "flv",
              "rmvb",
              "mkv",
              "gif",
              "mov",
              "rm",
              "3gp"
            ];
            var mainList = [];
            var mainList1 = [];
            res1.data.rows.forEach((item, index) => {
              imageGeShi.forEach(item1 => {
                if (
                  item.fileKey.substring(
                    item.fileKey.indexOf(".") + 1,
                    item.fileKey.length
                  ) == item1
                ) {
                  var index = item.fileKey.indexOf(".");
                  var photoType = item.fileKey.substring(
                    index,
                    item.fileKey.length
                  );
                  mainList.push({
                    name: "外业核查照片",
                    path: item.filePath,
                    type: 1,
                    flieType: photoType
                  });
                }
              });
            });
            res1.data.rows.forEach((item, index) => {
              videoGeShi.forEach(item1 => {
                if (
                  item.fileKey.substring(
                    item.fileKey.indexOf(".") + 1,
                    item.fileKey.length
                  ) == item1
                ) {
                  var index = item.fileKey.indexOf(".");
                  var vedioType = item.fileKey.substring(
                    index,
                    item.fileKey.length
                  );
                  mainList1.push({
                    name: "核查现场视频",
                    path: item.filePath,
                    type: 2,
                    flieType: vedioType
                  });
                }
              });
            });
            //名称处理
            mainList.forEach((item, index) => {
              item.name = item.name + (index != 0 ? index : "") + item.flieType;
            });
            mainList1.forEach((item, index) => {
              item.name = item.name + (index != 0 ? index : "") + item.flieType;
            });

            this.jgBasicInfo.imgArr = mainList.concat(mainList1);
          });
        });
      });
    },
    getCurListIndex(index) {
      //片块基本信息
      this.curIndex = index;
      if (this.curIndex != null) {
        this.getZongheInfo(this.list[this.curIndex].landId);
      }
    },

    exportOpinion() {
      // 导出意见
      this.$refs.tdMap.handleExportOpinion();
    },
    // 查看复垦前后的图片
    chakanImg(row, type) {
      this.seeImgDialog = true;
      this.panoramaImg = "";
      this.imgArr = [];
      if (type == 1) {
        this.seeImgTitle = "复垦前远近景照片";
        if (
          row.earlyMappingActivityDto != null ||
          row.earlyMappingActivityDto != ""
        ) {
          if (
            row.earlyMappingActivityDto.landPositionOneFilePath != null ||
            row.earlyMappingActivityDto.landPositionOneFilePath != "" ||
            row.earlyMappingActivityDto.landPositionOneFilePath != undefined
          ) {
            this.imgArr.push({
              fileName: "方位照1",
              filePath: row.earlyMappingActivityDto.landPositionOneFilePath,
              id: 1
            });
          }
          if (
            row.earlyMappingActivityDto.landPositionTwoFilePath != null ||
            row.earlyMappingActivityDto.landPositionTwoFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照2",
              filePath: row.earlyMappingActivityDto.landPositionTwoFilePath,
              id: 2
            });
          }
          if (
            row.earlyMappingActivityDto.landPositionThreeFilePath != null ||
            row.earlyMappingActivityDto.landPositionThreeFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照3",
              filePath: row.earlyMappingActivityDto.landPositionThreeFilePath,
              id: 3
            });
          }
          if (
            row.earlyMappingActivityDto.landPositionFourFilePath != null ||
            row.earlyMappingActivityDto.landPositionFourFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照4",
              filePath: row.earlyMappingActivityDto.landPositionFourFilePath,
              id: 4
            });
          }
          if (
            row.earlyMappingActivityDto.panoramagramFilePath != null ||
            row.earlyMappingActivityDto.panoramagramFilePath != ""
          ) {
            this.panoramaImg = row.earlyMappingActivityDto.panoramagramFilePath;
          }
        }
      } else if (type == 2) {
        this.seeImgTitle = "复垦后远近景照片";
        if (
          row.laterMappingActivityDto != null ||
          row.laterMappingActivityDto != ""
        ) {
          if (
            row.laterMappingActivityDto.positionOneFilePath != null ||
            row.laterMappingActivityDto.positionOneFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照1",
              filePath: row.laterMappingActivityDto.positionOneFilePath,
              id: 1
            });
          }
          if (
            row.laterMappingActivityDto.positionTwoFilePath != null ||
            row.laterMappingActivityDto.positionTwoFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照2",
              filePath: row.laterMappingActivityDto.positionTwoFilePath,
              id: 2
            });
          }
          if (
            row.laterMappingActivityDto.positionThreeFilePath != null ||
            row.laterMappingActivityDto.positionThreeFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照3",
              filePath: row.laterMappingActivityDto.positionThreeFilePath,
              id: 3
            });
          }
          if (
            row.laterMappingActivityDto.positionFourFilePath != null ||
            row.laterMappingActivityDto.positionFourFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照4",
              filePath: row.laterMappingActivityDto.positionFourFilePath,
              id: 4
            });
          }
          if (
            row.laterMappingActivityDto.panoramagramFilePath != null ||
            row.laterMappingActivityDto.panoramagramFilePath != ""
          ) {
            this.panoramaImg = row.laterMappingActivityDto.panoramagramFilePath;
          }
        }
      }
    },
    isChangeSelect(val) {
      // 是否显示选择错误类型
      if (val == "YES") {
        this.noWenti = true;
      } else if (val == "NO") {
        this.noWenti = false;
      }
    },
    // 打开外业审查意见弹框
    shenchaWy(row) {
      this.waiyeObj.landId = row.landId;
      this.getZongheInfo(row.landId);
      if (row.auditDto.isStoringRecordInspectionStatus == "VIEW") {
        this.waiyeObj.waiyeRadio = row.auditDto.isStoringRecordInspection;
      } else if (row.auditDto.isStoringRecordInspectionStatus == "AUDIT") {
        this.waiyeObj.waiyeRadio = "";
      }
      this.shenchaFlag2 = true;
    },
    // 提交外业意见
    submitWy() {
      let obj = {
        landId: this.waiyeObj.landId,
        projectId: localStorage.getItem("projectId"),
        isStoringRecordInspection: this.waiyeObj.waiyeRadio
      };
      this.fullscreenLoading = true;
      hgzAuditLandOuterInfo(obj)
        .then(res => {
          this.fullscreenLoading = false;
          if (res.code == 1000) {
            this.$message({
              message: "审查成功",
              type: "success"
            });
            this.shenchaFlag2 = false;
            this.getData();
          }
        })
        .catch(() => {
          this.fullscreenLoading = false;
        });
    },
    //关闭外业意见
    handleClose2() {
      this.shenchaFlag2 = false;
    },
    //提交意见(列表)
    submitYj1() {
      this.fullscreenLoading = true;
      var that = this;

      var data = {
        landId: this.itemDataForTable.landId,
        auditScaleChangeReasonType: this.itemDataForTable
          .problemReclaimPointOpinionType,
        auditScaleChangeReason: this.itemDataForTable
          .problemReclaimProblemRecord
      };
      auditSecondAuditInfo(data).then(res => {
        this.fullscreenLoading = false;
        if (res.code == 1000) {
          this.isText = true;
          this.$message({
            message: "审查成功",
            type: "success"
          });
          that.getData();
          that.shenchaFlag1 = false;

          that.itemDataForTable = {
            landId: "", // 片块ID
            problemReclaimProblemRecord: "",
            problemReclaimPointOpinionType: ""
          };
        }
      });
    },
    // 审查意见
    shenchaYj(row) {
      this.itemDataForTable.landId = row.landId;
      if (row.auditDto.landStatus == "VIEW") {
        this.itemDataForTable.problemReclaimProblemRecord =
          row.auditDto.auditScaleChangeReason;
        this.itemDataForTable.problemReclaimPointOpinionType =
          row.auditDto.auditScaleChangeReasonType;
        if (
          this.itemDataForTable.problemReclaimPointOpinionType == "NO_PROBLEM"
        ) {
          this.noWenti = false;
        } else {
          this.noWenti = true;
        }
      } else {
        this.itemDataForTable.problemReclaimProblemRecord = "";
        this.itemDataForTable.problemReclaimPointOpinionType = "";
        this.noWenti = true;
      }
      this.shenchaFlag1 = true;
    },

    // 校验审查
    checkTijiao() {
      this.$refs.tdMap.handleCheckOpinion({
        stage: "LandCertificate",
        path: "/xmss/ywdeal"
      });
    },
    changeNeiye(v) {
      if (v == "NO_PROBLEM") {
        this.noWenti = false;
      } else {
        this.noWenti = true;
      }
    },
    changeText(v) {
      if (v == "NO_PROBLEM") {
        this.isText = false;
      } else {
        this.isText = true;
      }
    },
    chakanYj(row, type) {
      this.$router.push({
        path: "/hegezhengPeihao/qianqichjgcs/detail",
        query: {
          id: row.landId,
          type: type,
          isLook: this.isLook
        }
      });
    },
    handleClose1() {
      this.shenchaFlag1 = false;
    },
    btnOpinion() {
      // 保存项目入库备案信息要件审查意见(附件意见)
      let obj = {
        projectId: localStorage.getItem("projectId"),
        accessoryId: this.attachment.id,
        opinion: this.opinionContent,
        opinionType: this.opinionValue,
        enclosureType: this.attachment.fileType
      };
      this.fullscreenLoading = true;
      saveCheckEnclosureOpinion(obj)
        .then(res => {
          this.fullscreenLoading = false;
          if (res.code == 1000) {
            this.$message({
              message: "提交成功",
              type: "success"
            });

            setTimeout(() => {
              this.getAttachment();
              this.showChaKan = false;
            }, 200);
          }
        })
        .catch(() => {
          this.fullscreenLoading = false;
        });
    },
    checkAttachment(item) {
      // 查看附件信息
      this.attachment = item;

      if (item.opinionStatus == "VIEW") {
        this.opinionValue = item.opinionType;
        this.opinionContent = item.opinion;
        if (this.opinionValue == "NO_PROBLEM") {
          this.isText = false;
        } else {
          this.isText = true;
        }
      } else {
        this.yijianContent = "";
        this.yijianValue = "";
        this.isText = true;
      }
      if (
        (item.opinionStatus == "VIEW" && item.code == "view") ||
        (item.opinionStatus == "AUDIT" && item.code == "view")
      ) {
        this.isShowCheck = false;
      } else {
        this.isShowCheck = true;
      }
      this.showChaKan = true;
    },
    getAttachment() {
      // 查询附件信息
      let obj = {
        projectId: localStorage.getItem("projectId")
      };
      queryCheckEnclosure(obj).then(res => {
        if (res.data != null) {
          if (res.data.attachmentList != null) {
            this.attachmentInfo = res.data.attachmentList;
          }
        }
      });
    },

    // 获取意见类型
    getOpinionType() {
      queryOpinionType().then(res => {
        this.wuowuList = res.data;
        this.cuowuListData = res.data;
      });
      getQuestionsOpinionType().then(res => {
        this.qswuowuList = res.data;
      });
    },

    getData() {
      // 获取列表数据
      this.listLoading = true;
      var data = {
        page: this.listQuery.page,
        size: this.listQuery.size,
        projectId: localStorage.getItem("projectId")
      };
      queryLandCertificateSectiondAuditInfo(data).then(res => {
        this.listLoading = false;
        this.list = res.data.rows;
        this.total = res.data.total;
      });
    },
    // 改变每页显示条数
    handleSizeChange(val) {
      this.listQuery.size = val;
      this.getData();
    },
    // 改变页码
    handleCurrentChange(num) {
      this.listQuery.page = num;
      this.getData();
    },
    changeLnglat(scope) {
      // 组件传值
      this.$refs.tdMap.changePkPosition(scope.$index);
    }
  }
};
</script>
<style lang="scss" scoped>
#qianqichjgcs /deep/ .el-tabs__nav-wrap::after {
  height: 1px;
}
#qianqichjgcs .mapBox {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 30px;
}
#qianqichjgcs .mapBox_left {
  width: 15%;
  border: 1px solid #e9e9e9;
  border-right: none;
}
#qianqichjgcs .mapBox_right {
  width: 85%;
  height: 600px;
}
#qianqichjgcs .ditudanghang {
  background: #f2f2f2;
  height: 40px;
  border-bottom: 1px solid #e9e9e9;
  overflow: hidden;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #4d4d4d;
  line-height: 40px;
}
.fujianShenCha {
  overflow: auto;
}
#qianqichjgcs .fujianList {
  margin-top: 30px;
  float: left;
  width: 25%;
  box-sizing: border-box;
  margin-right: 3%;
}
.chaKanBox {
  float: left;
  width: 70%;
  box-sizing: border-box;
}
#qianqichjgcs .fujianList_item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  margin-left: 30px;
}
#qianqichjgcs .fujianList_item p {
  width: 300px;
  font-size: 14px;
  font-weight: bold;
  text-align: left;
  color: #444;
}
#qianqichjgcs .dachuShenChaBox {
  position: relative;
}
#qianqichjgcs .dachuShenCha {
  position: absolute;
  right: 0;
  top: 4px;
  display: flex;
}
#qianqichjgcs .dachuShenCha .dachuShenCha_item {
  font-size: 14px;
  color: #4d4d4d;
  cursor: pointer;
}
#qianqichjgcs .dachuShenCha .dachuShenCha_item:first-child {
  margin-right: 35px;
}

.showDetail {
  display: flex;
  justify-content: space-between;
}
.chaKanBox_right_select {
  display: flex;
  align-items: center;
}
.chaKanBox_right_select p {
  font-size: 14px;
  color: #444;
  margin-right: 15px;
}
.chaKanBox_left {
  width: 70%;
  margin-right: 3%;
  height: calc(100vh - 250px);
}
.chaKanBox_right {
  width: 27%;
}
.chaKanBox_right_item {
  margin-bottom: 20px;
}
.chaKanBox_right_item_textarea {
  width: 100%;
}
.shenchaItem {
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.shenchaItem p {
  width: 230px;
  font-size: 14px;
  color: #444;
  font-weight: bold;
  text-align: left;
  white-space: nowrap;
}
.shenChaTanKuang /deep/ .el-dialog {
  width: 500px;
}
.shenchaItem_item_textarea {
  width: 100%;
}
.shenchaItem_item_noFlex p {
  font-size: 14px;
  color: #444;
  font-weight: bold;
  text-align: left;
  white-space: nowrap;
}
.shenchaItem_small {
  margin-top: 20px;
}
.shenchaItem_small p {
  width: 100px;
}
.shenchaItem_item_input {
  width: 260px;
}

/deep/ .el-tree-node__label {
  margin-left: 10px;
}
.seeImg {
  text-align: center;
  overflow: hidden;
}
.seeImg ul,
.seeImg li {
  list-style: none;
}
.seeImg li {
  float: left;
}
.seeImg li img {
  width: 400px;
  height: 400px;
  margin-right: 20px;
  margin-bottom: 20px;
}
#qianqichjgcs .CAD /deep/ .el-button--medium {
  border-radius: 4px 0 0 4px;
}
.tableBasicInfo {
  margin: 20px auto;
  font-size: 14px;
  text-align: center;
  width: 90%;
  border: 1px solid #ebeef5;
  box-sizing: border-box;
  border-bottom: 0px;
}

.tableBasicInfo tr th,
.tableBasicInfo tr td {
  border-bottom: 1px solid #ebeef5;
  padding: 5px 10px;
}
.tableBasicInfo tr th {
  border-right: 1px solid #ebeef5;
  color: #b3b3b3;
}
.tableBasicInfo tr td {
  color: #666;
}
.bgFujian {
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.fujianTitle {
  font-size: 16px;
  color: #333;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 5px;
}
.fujianContent {
  margin-left: 30px;
  background: #f5f8fa;
  width: 90%;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fujianName {
  font-size: 14px;
  font-weight: bold;
  color: #606266;
  cursor: pointer;
  margin-right: 20px;
  display: flex;
  align-items: center;
  width: 80%;
}
.fujianName .fujianNamePdf {
  margin: 0px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.fujianName .icon {
  display: block;
  font-size: 20px;
  margin-right: 10px;
  color: #409eff;
}

.isHover {
  color: #409eff;
  font-size: 13px;
  width: 50px;
}
.isHover span {
  padding: 0px 3px;
  margin: 3px 5px 3px 0;
  cursor: pointer;
  display: block;
  float: left;
}
</style>
